#include <iostream>
using std::cout ; 
using std::endl ; 

#include "GeneralType.hpp"

string GeneralType::getOptionText()  
{
	 string returnString = "" ; 
	 returnString += "\t-" ; 
	 returnString += mFlag ;
	 if(isInt()){
		 returnString += " <int> " ;
	 }
	 else
	 if(isDouble()){
		 returnString += " <double> " ;
	 }
	 else
	 if(isOption()){
		 returnString += " <string> " ;
	 }
	 else
	 if(isFlag()){
		 returnString += " <bool> " ;
	 }
	 else
	 if(isChar()){
		 returnString += " <char> " ;
	 }
	 returnString += " " ; 
	 returnString += "[" ; 
	 returnString +=  getDefaultAsString() ; 
	 returnString += "]" ; 
	 returnString += " " ; 
	 returnString += mShortDescription ; 
	 returnString += "  " ; 
	 returnString += mLongDescription ; 
   

	 return returnString ; 
	 
}

string GeneralType::getOptionXML()  
{
	string returnString = "" ; 
	returnString += "<flag>" ; 
	returnString += mFlag ; 
	returnString += "</flag>" ; 
	returnString += "\n" ; 
	returnString += "<type>" ; 
	 if(isInt()){
		 returnString += "int" ;
	 }
	 else
	 if(isDouble()){
		 returnString += "double" ;
	 }
	 else
	 if(isOption()){
		 returnString += "string" ;
	 }
	 else
	 if(isFlag()){
		 returnString += "bool" ;
	 }
	 else
	 if(isChar()){
		 returnString += "char" ;
	 }

	returnString += "</type>" ; 
	returnString += "\n" ; 
	returnString += "<default>" ; 
	returnString += getDefaultAsString() ; 
	returnString += "</default>" ; 
	returnString += "\n" ; 
	returnString += "<shortdescription>" ; 
	returnString += mShortDescription ; 
	returnString += "</shortdescription>" ; 
	returnString += "\n" ; 
	returnString += "<longdescription>" ; 
	returnString += mLongDescription ; 
	returnString += "</longdescription>" ; 

	return returnString ; 
	 
}


// -*- C++ -*-

// (C) 2006 by Nathan Dunn, <ndunn@mac.com>


